export default {
  data() {
    return {
      visitCount: 0,
    };
  },
  methods: {
    getVisitCount() {
      let visitCount = localStorage.getItem('visitCount');
      return visitCount ? parseInt(visitCount) : 0;
    },
    updateVisitCount() {
      let visitCount = this.getVisitCount() + 1;
      localStorage.setItem('visitCount', visitCount);
      return visitCount;
    },
  },
  mounted() {
    this.visitCount = this.updateVisitCount();
    // console.log(`总访问次数: ${this.visitCount}`);
  },
};